//import org.hibernate.*;
//import org.hibernate.cfg.*;
import net.sf.hibernate.*;
import net.sf.hibernate.cfg.*;
public class Test {

    public static void main(String[] args) {

        try {
            SessionFactory sf = new Configuration().configure().buildSessionFactory();
            Session session = sf.openSession();
            Transaction tx = session.beginTransaction();

            Customer customer = new Customer();
            customer.setUsername("hibernate2");
            customer.setPassword("customer");
            session.save(customer);

            tx.commit();
            session.close();

        } catch (HibernateException e) {
            e.printStackTrace();
        }
    }
}